import request from '@/utils/request'

// 查询角色列表
export const getRoleList = (data) => {
  return request.get('/sys/role', { params: data })
}

// 新增角色
export const addRole = (data) => request.post('/sys/role', data)

// 更新角色
export const updateRole = (data) => request.put(`/sys/role/${data.id}`, data)

// 删除角色
export const deleteRole = (id) => request.delete(`/sys/role/${id}`)

// 获取角色详情
export const getRoleDetail = (id) => request.get(`/sys/role/${id}`)

// 给角色分配权限
export const assignPerm = (data) => request.put('/sys/role/assignPrem', data)

